package com.gao.interceptordemo.config;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 登录拦截器
 * @author gaofeng
 * @date 2022年06月28日 21:20
 */
public class LoginHandlerInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        // 登录之后,应该有用户的session
        // 登录(没有) or 放行
        return HandlerInterceptor.super.preHandle(request, response, handler);
    }
}
